using System;
namespace Microsoft.Phone.Controls
{
	internal class YearDataSource : DataSource
	{
		protected override DateTime? GetRelativeTo(DateTime relativeDate, int delta)
		{
			if (1601 != relativeDate.get_Year())
			{
				if (3000 != relativeDate.get_Year())
				{
					int num = relativeDate.get_Year() + delta;
					int num2 = Math.Min(relativeDate.get_Day(), DateTime.DaysInMonth(num, relativeDate.get_Month()));
					return new DateTime?(new DateTime(num, relativeDate.get_Month(), num2, relativeDate.get_Hour(), relativeDate.get_Minute(), relativeDate.get_Second()));
				}
			}
			return default(DateTime?);
		}
	}
}
